
<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
 
<style type="text/css">
          html { height : 100% }
          body { height : 100%; margin: 0; padding: 0 }
          #map_canvas { height : 90% }
</style>
 
<script type = "text/javascript"
           src = "https://maps.googleapis.com/maps/api/js?sensor=true&key=AIzaSyCAIj5Eb_BouKmvvpyc0zeZMkYS-LJesm8">
</script>

 
<script type = "text/javascript">

var map = null;
var markers =null;
var minZoomLevel=2;
var centerMarker = null;
var prevCenter = null;


function pinSymbol(color) {
    return {
        path: 'M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30 a 2,2 0 1,1 4,0 2,2 0 1,1 -4,0',
        fillColor: color,
        fillOpacity: 1,
        strokeColor: '#000',
        strokeWeight: 1.5,
        scale: 0.6,
   };
}

function roundSymbol() {
    return {
        path: google.maps.SymbolPath.CIRCLE,
        fillColor: '#ff0000',
        fillOpacity: 0.5,
        strokeColor: '#ff0000',
        strokeWeight: 0.5,
        scale: 7,
   };
}

function adjustBounds(locations1 , locations2)
{

	var bounds = new google.maps.LatLngBounds();

	if(locations1 != null)
	{
		for (var i=0; i < locations1.length ; i++) 
		{
			bounds.extend(locations1[i]);
		}
	}

	if(locations2 != null)
	{
		for (var i=0; i < locations2.length ; i++) 
		{
			bounds.extend(locations2[i]);
		}
	}

	map.fitBounds(bounds);


	var south = bounds.getSouthWest().lat()-5;
	if(south < -90.0) south = bounds.getSouthWest().lat();

	var west = bounds.getSouthWest().lng()-5;
	if(west < -180.0) west = bounds.getSouthWest().lng();

	var north = bounds.getNorthEast().lat()+5;
	if(north > 90.0) north = bounds.getNorthEast().lat();

	var east = bounds.getNorthEast().lng()+5;
	if(east > 180.0) east = bounds.getNorthEast().lng();


	var bounds2 = new google.maps.LatLngBounds({lat: south , lng: west} , {lat: north , lng: east});
	map.fitBounds(bounds2);

	alert(bounds2);

}


function markLocations(locations ,  color , title)
{
	if(locations != null)
	{
		for(var i = 0 ; i < locations.length ; i ++)
		{
			var marker = new google.maps.Marker({
				position: locations[i],
				map: map,
				icon: pinSymbol(color),
				title: title + '_' + locations[i].articleId,
				encId: locations[i].encId
			});

			 google.maps.event.addListener(marker, 'click', function() {
				window.open('http://alive-story.com/v/'+this.encId, '_location_article_view' ,'width=1000,height=900');
			    });

			markers.push(marker);
		}
	}
}

function markCenter(center)
{
	if(prevCenter==null || prevCenter.lat().toFixed(6) != center.lat().toFixed(6) || prevCenter.lng().toFixed(6) != center.lng().toFixed(6))
	{
		if(centerMarker!=null)
		{
			centerMarker.setMap(null);
			centerMarker = null;
		}

		prevCenter = center;

		centerMarker = new google.maps.Marker({
			position: center,
			map: map,
			icon: roundSymbol(),
			title: 'center : (' + center.lat().toFixed(6) + ',' + center.lng().toFixed(6) + ')'
		});
	}

}

//[{lat : 15.9884, lng : 79.9175 , articleId : 123 , encId: 'adfasfa'},,,]
var androidLocations = [{lat: 43.7169, lng: -79.7269, articleId: 2887451, encId: '9NuxuVmKKebHgtfa2vRAvg'},{lat: 4.5831, lng: -74.085, articleId: 2887488, encId: 'tXq0D6c1VZhzd55LI_s41w'},{lat: 47.6592, lng: -122.3993, articleId: 2887619, encId: 'Glde6ht_PpJViv3YRXcDUw'},{lat: 52.4419, lng: -1.8478, articleId: 2887625, encId: '4F7njjdVG19noqTO63VmJA'},{lat: 52.4464, lng: -1.8314, articleId: 2887625, encId: '4F7njjdVG19noqTO63VmJA'},{lat: 52.4475, lng: -1.8311, articleId: 2887625, encId: '4F7njjdVG19noqTO63VmJA'},{lat: 52.4478, lng: -1.8311, articleId: 2887625, encId: '4F7njjdVG19noqTO63VmJA'},{lat: 36.2556, lng: -86.6958, articleId: 2887635, encId: '0yOv7GRa_3-eeZZArAgNrA'},{lat: 36.2558, lng: -86.696, articleId: 2887635, encId: '0yOv7GRa_3-eeZZArAgNrA'},{lat: 36.2558, lng: -86.6959, articleId: 2887635, encId: '0yOv7GRa_3-eeZZArAgNrA'},{lat: 36.2564, lng: -86.6962, articleId: 2887635, encId: '0yOv7GRa_3-eeZZArAgNrA'},{lat: -3.8181, lng: -38.4978, articleId: 2887700, encId: 'cOSj7uamsn998CqA-HEORg'},{lat: 2.1622, lng: 37.4814, articleId: 2887700, encId: 'cOSj7uamsn998CqA-HEORg'},{lat: 52.4461, lng: -1.8253, articleId: 2887702, encId: 'ycIcUlXqSQ8FeDvOrsbxxA'},{lat: 40.0433, lng: -75.1025, articleId: 2887828, encId: 'gW5TaE2wAuEBFzYGU1nDgA'},{lat: 34.0769, lng: -118.1792, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0775, lng: -118.1789, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0778, lng: -118.1789, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0789, lng: -118.1781, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0817, lng: -118.1803, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0817, lng: -118.1792, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.0872, lng: -118.0947, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.1019, lng: -118.1231, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.1294, lng: -118.1114, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.1303, lng: -118.1097, articleId: 2888019, encId: 'rd3DCr3BiBa0Q0qJMcez0w'},{lat: 34.9511, lng: -85.2842, articleId: 2888024, encId: 'nmzSTUTMZrCghdkJn0JPpw'},{lat: 19.2562, lng: 72.9799, articleId: 2888145, encId: 'I-myIGughFrWKq3E0Pyyig'},{lat: 19.2588, lng: 72.965, articleId: 2888145, encId: 'I-myIGughFrWKq3E0Pyyig'},{lat: 20.4661, lng: 79.4448, articleId: 2888148, encId: '7trJsjWwzaX4NTfrzC7t3g'},{lat: 20.4663, lng: 79.4448, articleId: 2888148, encId: '7trJsjWwzaX4NTfrzC7t3g'},{lat: -23.6803, lng: -46.8525, articleId: 2888211, encId: 'IXDObXxaiJel_xWv5z0zlg'},{lat: -23.4517, lng: -46.4058, articleId: 2888211, encId: 'IXDObXxaiJel_xWv5z0zlg'},{lat: 31.7283, lng: -106.4089, articleId: 2888213, encId: 'Kbtan4lwppINrlHN8pSDEw'},{lat: 33.5233, lng: -112.0231, articleId: 2888224, encId: 'vhfnGIjUHd6mHO--GpHimw'},{lat: 34.9143, lng: -111.8539, articleId: 2888263, encId: 'XksFwRFc_xtIoGEKdP31rg'},];
var iOSLocations = [{lat: -37.8194, lng: 145.036, articleId: 2887457, encId: '9HgfOM6LDb5Md466RkANOQ'},{lat: -37.8194, lng: 145.0361, articleId: 2887457, encId: '9HgfOM6LDb5Md466RkANOQ'},{lat: 35.3197, lng: 139.5398, articleId: 2887461, encId: '1iC_1-VfNo1xvuaE7rMIEw'},{lat: 35.3245, lng: 139.5399, articleId: 2887461, encId: '1iC_1-VfNo1xvuaE7rMIEw'},{lat: 35.3246, lng: 139.5389, articleId: 2887461, encId: '1iC_1-VfNo1xvuaE7rMIEw'},{lat: 45.4645, lng: 9.1925, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 45.4646, lng: 9.1892, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 45.4651, lng: 9.19, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 45.4656, lng: 9.1915, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 45.4656, lng: 9.1916, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 45.4657, lng: 9.1915, articleId: 2887465, encId: 'SuCLct0BYfKiylfe3nzcxQ'},{lat: 51.5763, lng: -0.1405, articleId: 2887467, encId: 'PjlLJHYcLCLwXtcJNFQeQA'},{lat: 33, lng: -117, articleId: 2887504, encId: 'kdQI3fmFDuAnnEO7Z7fYQA'},{lat: 33.7927, lng: -84.4482, articleId: 2887515, encId: 'nsVna4m1utaDgc4vzzuhgw'},{lat: -3, lng: -40, articleId: 2887516, encId: 'MgpofAkL28bwWatl_n3XwA'},{lat: -3, lng: -40, articleId: 2887524, encId: 'XUThh4g7fglOTqOTpNbPxg'},{lat: 23.5442, lng: 116.5822, articleId: 2887534, encId: 'f5JmSetqdLAiD08_WSEggg'},{lat: 17.2397, lng: 78.4304, articleId: 2887536, encId: 'sTZik7hAzR9yNM_uXiXV5A'},{lat: 36.9696, lng: -121.9608, articleId: 2887566, encId: 'YpV3-IlFGOFzcUa-RohlQg'},{lat: -6, lng: 106, articleId: 2887567, encId: '1xHGiDjZkNQBawlXPAxZ7g'},{lat: 48.4846, lng: -99.2025, articleId: 2887591, encId: 'JmuwsJpnAvLXYh8IJCcOQA'},{lat: -20, lng: -49, articleId: 2887613, encId: 'ShXLAvrjYUYaqIosOGh1Pg'},{lat: -43.4934, lng: 172.6121, articleId: 2887632, encId: '9syMsYg9euRP5O9PEWqJrg'},{lat: -20, lng: -49, articleId: 2887642, encId: 'G5Oct6x_4bNbp3bh2jWzjw'},{lat: 42.3082, lng: -84.4051, articleId: 2887648, encId: 'Bcj7N9pDYTSJEtA8FPSJCg'},{lat: 51, lng: 31, articleId: 2887649, encId: 'bxNGNHnsICAA5Lv0Cv7m_A'},{lat: 40, lng: 29, articleId: 2887651, encId: 'qVvoOuvnsjxmwuJResf9yQ'},{lat: 41, lng: 28, articleId: 2887651, encId: 'qVvoOuvnsjxmwuJResf9yQ'},{lat: 40.4748, lng: -111.8416, articleId: 2887670, encId: 'jvY3YCoVrDVLZDMwCC5hpA'},{lat: 42.3082, lng: -84.4051, articleId: 2887680, encId: 'Fqfo2sDNvfIc8AhvIJxzqA'},{lat: -17.4955, lng: 145.6106, articleId: 2887682, encId: 'HsmsKYk0U7HVZ3q1Pp56_w'},{lat: -17.2456, lng: 145.6428, articleId: 2887682, encId: 'HsmsKYk0U7HVZ3q1Pp56_w'},{lat: -17.2454, lng: 145.6391, articleId: 2887682, encId: 'HsmsKYk0U7HVZ3q1Pp56_w'},{lat: -16.9204, lng: 145.778, articleId: 2887682, encId: 'HsmsKYk0U7HVZ3q1Pp56_w'},{lat: 2.9596, lng: 101.754, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 2.9597, lng: 101.7537, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 2.9608, lng: 101.7538, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0622, lng: 101.7112, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0672, lng: 101.7053, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0674, lng: 101.7053, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0674, lng: 101.7054, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0675, lng: 101.7052, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0675, lng: 101.7057, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0676, lng: 101.7052, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0677, lng: 101.7054, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: 3.0678, lng: 101.7056, articleId: 2887684, encId: 'BL7IgyUjpTMOWTb8x0zptA'},{lat: -27, lng: -48, articleId: 2887685, encId: 'V0KVisRmtffBEWaa9CtAhw'},{lat: 27.8095, lng: 113.1137, articleId: 2887686, encId: 'EutbpLAN6opK2YE_MQJm7g'},{lat: 13.6637, lng: 100.6241, articleId: 2887697, encId: 's4jWAQyM6k-g5KLzIdqMyQ'},{lat: 55, lng: 37, articleId: 2887709, encId: 'YqXgSIqPQ6V5VSKlW3tN1w'},{lat: 34.2841, lng: -118.8878, articleId: 2887727, encId: 'I5R5Xodoal0eXQdLEC7zHw'},{lat: 34.2842, lng: -118.8876, articleId: 2887727, encId: 'I5R5Xodoal0eXQdLEC7zHw'},{lat: 34.2843, lng: -118.8877, articleId: 2887727, encId: 'I5R5Xodoal0eXQdLEC7zHw'},{lat: 34.2843, lng: -118.8876, articleId: 2887727, encId: 'I5R5Xodoal0eXQdLEC7zHw'},{lat: 38.7293, lng: -121.297, articleId: 2887729, encId: 'KBpy-64jy2acLhE3tnd67g'},{lat: -20.2457, lng: 149.0206, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -17.8675, lng: 146.1085, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -17.8219, lng: 146.0913, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -17.8188, lng: 146.0879, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -17.4957, lng: 145.6104, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -17.2458, lng: 145.6396, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -16.47, lng: 145.3299, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: -16.0675, lng: 145.4642, articleId: 2887743, encId: 'qP-VXsJJIO7Ms0oY8QrOZQ'},{lat: 41.9868, lng: -88.3038, articleId: 2887783, encId: 'HiONeORo3LZCzLweN07FGQ'},{lat: 41.987, lng: -88.304, articleId: 2887783, encId: 'HiONeORo3LZCzLweN07FGQ'},{lat: 41.987, lng: -88.3039, articleId: 2887783, encId: 'HiONeORo3LZCzLweN07FGQ'},{lat: -0.9534, lng: 100.4282, articleId: 2887788, encId: '5EONwuwmimSI9pPe2hgJ4g'},{lat: 31, lng: 120, articleId: 2887796, encId: '02e3SfjOAbiq1rHL_-V0Ew'},{lat: -35.4552, lng: 149.0983, articleId: 2887815, encId: '4s-WT6Nwlf_a9MQC0Fn-dw'},{lat: -35.4551, lng: 149.0982, articleId: 2887815, encId: '4s-WT6Nwlf_a9MQC0Fn-dw'},{lat: -35.455, lng: 149.0982, articleId: 2887815, encId: '4s-WT6Nwlf_a9MQC0Fn-dw'},{lat: -35.455, lng: 149.0983, articleId: 2887815, encId: '4s-WT6Nwlf_a9MQC0Fn-dw'},{lat: -35.4549, lng: 149.0982, articleId: 2887815, encId: '4s-WT6Nwlf_a9MQC0Fn-dw'},{lat: 25.5471, lng: -80.3816, articleId: 2887820, encId: 'qp78O70bOJQ9SkRFp57cgA'},{lat: 5.6335, lng: 100.5363, articleId: 2887824, encId: 'zbawDJC-NscjX5pJggK0gA'},{lat: 41.996, lng: -87.6575, articleId: 2887827, encId: 'OKVFMSSnJkvYCdNT-wtr3g'},{lat: 44.599, lng: -123.3019, articleId: 2887831, encId: 'C2-yzj1OUm3o0P-Z3IcMmA'},{lat: 42.2242, lng: -83.5726, articleId: 2887841, encId: '1MTCnvZtvteU7PxpGVs9CA'},{lat: 42.2242, lng: -83.5725, articleId: 2887841, encId: '1MTCnvZtvteU7PxpGVs9CA'},{lat: 42.2243, lng: -83.5726, articleId: 2887841, encId: '1MTCnvZtvteU7PxpGVs9CA'},{lat: 42.2243, lng: -83.5725, articleId: 2887841, encId: '1MTCnvZtvteU7PxpGVs9CA'},{lat: 42.2245, lng: -83.5724, articleId: 2887841, encId: '1MTCnvZtvteU7PxpGVs9CA'},{lat: 31.8941, lng: -93.3184, articleId: 2887852, encId: 'Tjc6B-Go_Zi1jOPQP0Z5SQ'},{lat: 39.772, lng: 116.3234, articleId: 2887858, encId: 'o1YAKEbpLge-L6FOd3JYtw'},{lat: 37.9732, lng: -84.2156, articleId: 2887863, encId: 'PFbdl_XJDZyhBt4W_zCIWA'},{lat: 59, lng: 17, articleId: 2887875, encId: 'Aaz9PXg5mg-t9jrBvw1YEA'},{lat: 39.2478, lng: -94.6342, articleId: 2887892, encId: 'dRJ-Q5Mc-H7LfaLTM2sflA'},{lat: 2.3043, lng: 102.1686, articleId: 2887895, encId: 'rfFkHJiMXTyAazS0H2rIXA'},{lat: 1.2848, lng: 103.8648, articleId: 2887898, encId: 'Lr4yNuxAs3Y1-jYqd8OdZA'},{lat: 39.2478, lng: -94.6342, articleId: 2887915, encId: '0vRPSjVwDdRCfuCPhAnz_w'},{lat: -0.4002, lng: 101.355, articleId: 2887928, encId: 'zQJsX-u_wxrD_SpbhCEf-g'},{lat: 39, lng: 66, articleId: 2887945, encId: 'EID8iA2GDg6enTiksGAewQ'},{lat: 43.5584, lng: -90.9005, articleId: 2887954, encId: '83ANoRk9sMVr3ad9QUZN8A'},{lat: 43.5753, lng: -90.9128, articleId: 2887954, encId: '83ANoRk9sMVr3ad9QUZN8A'},{lat: 43.5753, lng: -90.9127, articleId: 2887954, encId: '83ANoRk9sMVr3ad9QUZN8A'},{lat: 43.7319, lng: -91.0965, articleId: 2887954, encId: '83ANoRk9sMVr3ad9QUZN8A'},{lat: 25.9197, lng: 115.2545, articleId: 2888012, encId: 'vHdVQErl2P2LeBqj3VdH5g'},{lat: 30.7627, lng: 102.6777, articleId: 2888028, encId: '0_iA_9mqPV6N5S1Excb4GQ'},{lat: 40.4748, lng: -111.8419, articleId: 2888075, encId: 'E0CIADpdv9hKtwTb3ShVvg'},{lat: -6, lng: -36, articleId: 2888079, encId: 'RpLGAMxuxjDR0sSh3DbOWA'},{lat: -0.6796, lng: 100.7731, articleId: 2888083, encId: 'RvDQ4y_QjLwmIIgyC2WlAQ'},{lat: 24.0322, lng: 110.0783, articleId: 2888091, encId: 'j_xuoC5ze2r77PITj3sD6g'},{lat: 24.0323, lng: 110.0784, articleId: 2888091, encId: 'j_xuoC5ze2r77PITj3sD6g'},{lat: 24.0329, lng: 110.0787, articleId: 2888091, encId: 'j_xuoC5ze2r77PITj3sD6g'},{lat: 24.0329, lng: 110.0788, articleId: 2888091, encId: 'j_xuoC5ze2r77PITj3sD6g'},{lat: 24.0382, lng: 110.0935, articleId: 2888091, encId: 'j_xuoC5ze2r77PITj3sD6g'},{lat: 41.339, lng: -72.067, articleId: 2888101, encId: '7LK84dL5E5nqy2HfLCK2ug'},{lat: 3.2207, lng: 101.5951, articleId: 2888115, encId: 'HfD3zaHBqU_xPTckLCRQSQ'},{lat: 43.0506, lng: -76.1533, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.6667, lng: -76.0782, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.7346, lng: -76.059, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.7348, lng: -76.059, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.735, lng: -76.059, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.735, lng: -76.0588, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.7351, lng: -76.0588, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 43.7351, lng: -76.0587, articleId: 2888144, encId: 'pBGCUEmos2RfWGlpFrNeog'},{lat: 41.3388, lng: -72.0669, articleId: 2888149, encId: '56n1WrkSiALMCw3RA_-AOg'},{lat: -39.4981, lng: 176.9169, articleId: 2888153, encId: '6YG6Xzu-YqPFUGfU5fNqng'},{lat: -39.4981, lng: 176.917, articleId: 2888153, encId: '6YG6Xzu-YqPFUGfU5fNqng'},{lat: -39.4981, lng: 176.9171, articleId: 2888153, encId: '6YG6Xzu-YqPFUGfU5fNqng'},{lat: -39.4929, lng: 176.9171, articleId: 2888153, encId: '6YG6Xzu-YqPFUGfU5fNqng'},{lat: 37.6886, lng: -122.0368, articleId: 2888178, encId: 'Lgqq6NC0z8-8yts1-Oi6rA'},{lat: 23.5757, lng: 72.9806, articleId: 2888204, encId: 'UNBTrZDjBJC5jVgP9ZI6Ew'},{lat: 41.3533, lng: -72.0769, articleId: 2888208, encId: 'YcegOvrV7tR2xyCxwWRzaA'},{lat: 53, lng: 50, articleId: 2888238, encId: 'Nlx1X5fJBQPoDR-5nMCPsQ'},];

function removeMarkers()
{
	if(markers != null)
	{
		for (var i = 0; i < markers.length; i++) {
			markers[i].setMap(null);
		}
	}

	markers = [];
}


function viewAll()
{
	removeMarkers();

	//adjustBounds(androidLocations , iOSLocations);
	markLocations(iOSLocations , '#f49242' , 'iOS');
	markLocations(androidLocations , '#42e8f4' , 'Android');
}

function viewAndroid()
{
	removeMarkers();

	//adjustBounds(androidLocations , null);
	markLocations(androidLocations ,  '#42e8f4' , 'Android');
}

function viewiOS()
{
	removeMarkers();

	//adjustBounds(null , iOSLocations);
	markLocations(iOSLocations , '#f49242' , 'iOS');
}


var searchBox = new google.maps.places.SearchBox(document.getElementById('address'));

function initialize(){
	var latlng = new google.maps.LatLng(30, 150);
	var myOptions = {
		zoom: minZoomLevel,
		center:latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

	// Limit the zoom level
	map.addListener('zoom_changed', function() {
		if (this.getZoom() < minZoomLevel) this.setZoom(minZoomLevel);

		//alert(this.getBounds());
	});

	map.addListener('bounds_changed', function() {
		changeCenter(this.getCenter());
		searchBox.setBounds(map.getBounds());
	});

	viewAll();
}

function changeCenter(center)
{
	document.getElementById("centerLat").value=center.lat().toFixed(6) % 90.0;
	document.getElementById("centerLon").value=center.lng().toFixed(6) % 180.0;
	document.getElementById("viewZoom").value=map.getZoom();

	markCenter(center);

}

function changeArea()
{
	var lat = parseFloat(document.getElementById("centerLat").value);
	var lon = parseFloat(document.getElementById("centerLon").value);
	var zoom = parseFloat(document.getElementById("viewZoom").value);

	map.setCenter({lat: lat , lng : lon});
	map.setZoom(zoom);
}

function changeOS() 
{
	var selectBox = document.getElementById("osSelectBox");
	var selectedValue = selectBox.options[selectBox.selectedIndex].value;

	switch(selectedValue)
	{
		case '1': 
			viewAll();
			break;
		case '2':
			viewAndroid();
			break;
		default: 
			viewiOS();

	}

}



if(false)
{
	alert('2016-12-20 : There is no registered location');
	window.close();
}




</script>

</head>
<body onload="initialize()">
			<br>
			<div>
			&nbsp;<font color=blue>2016-12-20</font>
			&nbsp;&nbsp;	OS : <select id="osSelectBox" onchange="changeOS();">
					<OPTION SELECTED value=1>ALL</option>
					<OPTION value=2>Android</option>
					<OPTION value=3>iOS</option>
				</SELECT>  &nbsp;&nbsp;
				<b>CENTER</b> lat: <input type=text size=8 id=centerLat> lon: <input type=text size=8 id=centerLon> 
				zoom : <select id=viewZoom> 
					<option  value=2>2</option>
					<option  value=3>3</option>
					<option  value=4>4</option>
					<option  value=5>5</option>
					<option  value=6>6</option>
					<option  value=7>7</option>
					<option  value=8>8</option>
					<option  value=9>9</option>
					<option  value=10>10</option>
					<option  value=11>11</option>
					<option  value=12>12</option>
					<option  value=13>13</option>
					<option  value=14>14</option>
					<option  value=15>15</option>
					<option  value=16>16</option>
					<option  value=17>17</option>
					<option  value=18>18</option>
					<option  value=19>19</option>
					<option  value=20>20</option>
					<option  value=21>21</option>
					</select>
				<button onclick='changeArea()'>CHANGE</button>

				&nbsp;<input id="address" length=50 type="text">
				<button onclick='searchAddress()'>SEARCH</button>
			</div>
			<br>
            <div id="map_canvas" style="width:100%; height:90%"></div>

</body>
</html>

